<template>
  <div class="content">
    <navBar :navBar="navBar"></navBar>
    <div class="con">
      <div class="oneline" @click="go(1)">
        <img src="../../assets/images/zichan/card.png" alt="" />
        <span>{{$t('添加银行卡(国际)')}}</span>
      </div>
      <div class="oneline" @click="go(2)">
        <img src="../../assets/images/zichan/card.png" alt="" />
        <span>{{$t('添加银行卡')}}</span>
      </div>
      <div class="tishi">{{$t('若要修改或者删除银行卡信息，请联系客服')}}</div>
      <div class="list">
        <div class="card" v-for="(item, index) in list" :key="index">
          <div class="cardline">
            <div class="name">{{$t('姓名')}}:</div>
            <div class="num">{{ item.name }}</div>
          </div>
          <div class="cardline">
            <div class="name">{{$t('银行卡号')}}:</div>
            <div class="num">{{ item.bank_no }}</div>
          </div>
          <div class="cardline">
            <div class="name">{{$t('银行名称')}}:</div>
            <div class="num">{{ item.bank_name }}</div>
          </div>
          <div class="cardline">
            <div class="name">{{$t('开户省市')}}:</div>
            <div class="num">{{ item.province }}</div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import navBar from "@/components/navBar.vue";
export default {
  name: "bankCard",
  components: { navBar },
  data() {
    return {
      navBar: {
        back: true,
        title: this.$t("收款方式管理"),
        close: false,
        btn: "",
        isBlue: true,
      },
      list: [],
    };
  },
  created() {},
  mounted() {
    this.getlist();
  },

  methods: {
    go(id) {
      if (id == 1) {
        this.$router.push({
          name: "bankWorld",
        });
      } else {
        this.$router.push({
          name: "bank-add",
        });
      }
    },
    onClickLeft() {
      this.$router.go(-1);
    },
    getlist() {
      $postAxios(api.getBankList, {}, (res) => {
        this.list = res.data;
      });
    },
  },
};
</script>

<style lang="scss" scoped>
.content {
  width: 100%;
  min-height: 100vh;
  height: auto;
  background-color: rgba(247, 246, 251, 1);
  .emptyBox {
    width: 100%;
    height: 40px;
  }
  .con {
    width: 100%;
    position: absolute;
    left: 0;
    top: 40px;
    bottom: 0;
    box-sizing: border-box;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 20px 0;
    .oneline {
      width: 100%;
      display: flex;
      align-items: center;
      box-sizing: border-box;
      padding: 12px 20px;
      border-radius: 15px;
      background-color: #fff;
      box-shadow: 0px 2px 5px 0px rgb(3 3 3 / 5%);
      margin-bottom: 30px;
      img {
        width: 23px;
        height: 16px;
      }
      span {
        font-size: 12px;
        color: #333333;
        padding-left: 10px;
      }
    }
    .tishi {
      font-size: 12px;
      color: #333333;
      font-weight: bold;
    }
    .list {
      padding: 20px 0;
      .card {
        padding: 0 10px;
        background: #ffffff;
        border-radius: 5px;
        margin-bottom: 10px;
        .cardline {
          display: flex;
          align-items: center;
          justify-content: space-between;
          padding: 5px 0;
          .name {
            font-size: 13px;
            color: #8d9dbc;
          }
          .num {
            font-size: 13px;
            color: #333333;
          }
        }
      }
    }
  }
}
</style>
